﻿

CallTask();
Console.ReadKey();


static async void CallTask()
{
    Task<string> task = await new AAA().GetStrAsync();

    try
    {
        string result = await task;
    }
    catch
    {

    }

}


class AAA
{
    public Task<Task<string>> GetStrAsync()
    {
        return Task.Factory.StartNew(async () =>
        {
            await Task.Delay(5000); // 模拟异步操作
            throw new Exception("模拟异常");
            return "Hello, World!";
        });
    }
}

